<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>更换密码</title>
    <!-- 引入 layui.css -->
    <link href="//unpkg.com/layui@2.9.14/dist/css/layui.css" rel="stylesheet">
    <!-- 引入 layui.js -->
    <script src="//unpkg.com/layui@2.9.14/dist/layui.js"></script>
    <!-- 引入 jquery -->
    <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
    <!-- 引入 distpicker -->
    <script src="https://cdn.jsdelivr.net/npm/distpicker/dist/distpicker.min.js"></script>
    <style>
        #header{
            position: absolute;
            top: 0;
            left: 0;
            z-index: 10;
        }
        #sidebar{
            display: flex;
            flex-direction: column;
            position: fixed;
            top: 50px; /* 留出头部导航的高度 */
            bottom: 0;
            left: 0;
            width: 200px;
            height: 100%;
            padding: 10px;
            margin-top: 30px;
        }
        #content {


            margin-top: 100px;
            width:51%;
            border: 1px solid gold;

        }
        #userHead{
            border-radius: 50%!important;
            overflow: hidden;
            width: 15%;
            height: 15%;
        }
        .container {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            z-index: 10;
            border: none;
            /*padding: 10px;*/

        }
        .layui-nav *{
            font-size: 20px;
        }
        .layui-nav-tree.layui-nav-side{
            position: relative;
            margin-top: 10px;
        }
    </style>

</head>

<div id="header" class="layui-form layui-col-xs12 layui-bg-gray">
    <div class="container layui-header">
        <ul class="layui-nav layui-layout-left  layui-bg-gray" >
            <!-- 移动端显示 -->
            <li class="layui-nav-item layui-hide-xs">
                <img style="width: 40px;height: 40px; padding: 10px" src="../photos/rqbl.png" alt="图片">
            </li>
            <li class="layui-nav-item layui-hide-xs">
                <input type="text" placeholder="" class="layui-input">
                <div class="layui-input-split" style="cursor: pointer;">
                    <i class="layui-icon layui-icon-search"></i>
                </div>

            </li>
            <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                <i class="layui-icon layui-icon-spread-left"></i>
            </li>
            <li class="layui-nav-item "><a href="">首页</a></li>
            <li class="layui-nav-item "><a href="individual_center.html">个人中心</a></li>
            <li class="layui-nav-item "><a href="pal_acc_setting.html">账号设置</a></li>
        </ul>
    </div>
</div>
<!--垂直导航-->
<div id="sidebar" class="layui-col-xs3 layui-col-xs-offset1">
    <ul  class="layui-nav layui-nav-tree layui-nav-side layui-bg-gray">
        <span class="layui-nav-item" style="padding-left: 10px">
             <h3>设置</h3>
        </span>
        <li class="layui-nav-item">
            <a  href="pal_acc_setting.html">
                <i class="layui-icon layui-icon-home">  编辑资料</i>
            </a>
        </li>
        <li class="layui-nav-item">
            <a>
                <i class="layui-icon layui-icon-user">  账号安全</i>
            </a>
            <dl class="layui-nav-child">
                <div class="layui-input-wrap">
                    <div class="layui-input-prefix">
                        <i class="layui-icon layui-icon-email"></i>
                    </div>
                    <dd style="margin-left: 10px"><a href="update_emailBox.html">更改邮箱</a></dd>
                </div>
                <div class="layui-input-wrap">
                    <div class="layui-input-prefix">
                        <i class="layui-icon layui-icon-password"></i>
                    </div>
                    <dd style="margin-left: 10px"><a href="updatepwd.html">更改密码</a></dd>
                </div>
            </dl>
        </li>
        <li class="layui-nav-item">
            <a href="accusation.html"> <i class="layui-icon layui-icon-friends">   账号投诉</i></a>
        </li>
    </ul>
</div>
<form class="layui-form" action="">
    <div id="content" class="layui-col-xs-offset3">

        <h2 style="text-align: center">更换密码</h2>

        <div class="layui-form-item" >
            <lable class="layui-form-label">原密码</lable>
            <div class="layui-input-inline layui-input-wrap">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-key"></i>
                </div>
                <!--                这里放用户之前的密码-->
                <input type="text" name="email" id="email" lay-verify="required" lay-reqtext="请输入原密码" class="layui-input" placeholder="原密码" value="">
            </div>
        </div>

        <div class="layui-form-item" >
            <lable class="layui-form-label">新密码</lable>
            <div class="layui-input-inline layui-input-wrap" >
                <div>
                    <input type="password" id="password" name="password" lay-verify="required" lay-reqtext="请填写新密码" placeholder="请输入" autocomplete="off" lay-affix="eye" class="layui-input">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">确定密码</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="password" name="password" lay-verify="required|confirmPassword" lay-reqtext="请确定密码" placeholder="请输入" autocomplete="off" lay-affix="eye" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item" >
            <div class="layui-input-inline layui-input-wrap" >

                <button style="margin-left: 110px" class="layui-btn layui-btn-primary layui-border-green" lay-submit lay-filter="demo-reg">注册</button>
            </div>
        </div>
    </div>
</form>
<script>
layui.use(function(){
var $ = layui.$;
var form = layui.form;
var layer = layui.layer;
var util = layui.util;
    // 自定义验证规则
    form.verify({
        // 确认密码
        confirmPassword: function(value, item){
            var passwordValue = $('#password').val();
            if(value !== passwordValue){
                return '两次密码输入不一致';
            }
        }
    });

    // 提交事件
    form.on('submit(demo-reg)', function(data){
        var field = data.field; // 获取表单字段值
        // 显示填写结果，仅作演示用

        layer.alert(JSON.stringify(field), {
            title: '当前填写的字段值'
        });

        // 此处可执行 Ajax 等操作
        // …

        return false; // 阻止默认 form 跳转
    });

    });
</script>
</body>
</html>
